﻿/*
Copyright (c) 2011 <a href="http://www.gutgames.com">James Craig</a>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/

#region Usigns
using System.Data;
using Utilities.SQL;
#endregion

namespace HaterAide.SQL.Interfaces.SQL
{
    /// <summary>
    /// The Variable base class
    /// </summary>
    public class IVariable
    {
        #region Constructor

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="Name">The name of the variable</param>
        /// <param name="Value">The value of the variable</param>
        /// <param name="DataType">The SQL data type of the variable</param>
        public IVariable(string Name, object Value,SqlDbType DataType)
        {
            _Name = Name;
            _Value = Value;
            _DataType = DataType;
            InsertID = false;
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="Name">The name of the variable</param>
        /// <param name="Value">The value of the variable</param>
        /// <param name="DataType">The SQL data type of the variable</param>
        /// <param name="Size">Size of the text</param>
        public IVariable(string Name, object Value, SqlDbType DataType,int Size)
        {
            _Name = Name;
            _Value = Value;
            _DataType = DataType;
            this.Size = Size;
            InsertID = false;
        }

        #endregion

        #region Internal Functions

        /// <summary>
        /// Sets up the sql helper
        /// </summary>
        /// <param name="Helper">The SQL helper</param>
        internal virtual void SetupSQL(SQLHelper Helper) { }

        #endregion

        #region Protected Variables

        protected string _Name = "";
        protected object _Value = null;
        protected SqlDbType _DataType;
        protected int Size = 0;

        #endregion

        #region Internal Properties

        internal bool InsertID { get; set; }

        #endregion
    }
}
